package com.example.demo.service;

import com.example.demo.domain.Elder;
import com.example.demo.domain.Employee;
import com.example.demo.mapper.EmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class EmployeeServiceImpl implements EmployeeService{
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public int addEmployee(Employee employee) {
        return employeeMapper.InsertEmployee(employee);
    }

    @Override
    public int deleteEmployee(Integer id) {
        return employeeMapper.DeleteEmployee(id);
    }

    @Override
    public Employee selectEmployee(Integer elder_id) {
        return employeeMapper.SelectEmployee(elder_id);
    }

    @Override
    public int updateEmployee(Employee employee) {
        return employeeMapper.UpdateEmployee(employee);
    }

    @Override
    public List<Employee> findAll() {
        return employeeMapper.SelectAll();
    }

    @Override
    public int selectAge(Integer min, Integer max) {
        return employeeMapper.SelectAge(min, max);
    }
}
